abstract class Animal{
    String name;
    int age;
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public abstract void bark();
}
/*class Dog extends Animal{
    @Override
    public void bark(){
        System.out.println("正在旺旺叫.....");
    }
}

class Cat extends Animal{
    @Override
    public void bark(){
        System.out.println("正在喵喵叫.....");
    }
}*/
public class test2 {
    public static void main(String[] args) {
       /* Animal animal1 = new Dog();
        Animal animal2 = new Cat();
        animal1.bark();
        animal2.bark();*/
        Animal animal = new Animal("1",1) {
            @Override
            public void bark() {
                System.out.println("1");
            }
        };
        animal.bark();
    }
}
